using System;
using System.Text;

namespace RealState.BusinessObjects
{
	[Serializable()]
	public class TradeTypes
	{
        private int _RowNum;

        public int RowNum
        {
            get { return _RowNum; }
            set { _RowNum = value; }
        }

		private int _Id;

		public int Id
		{
			get { return _Id; }
			set { _Id = value; }
		}

		private string _Title;

		public string Title
		{
			get { return _Title; }
			set { _Title = value; }
		}

		public TradeTypes()
		{ }

		public TradeTypes(int Id,string Title)
		{
			this.Id = Id;
			this.Title = Title;
		}

		public override string ToString()
		{
			return "Id = " + Id.ToString() + ",Title = " + Title;
		}

		public class IdComparer : System.Collections.Generic.IComparer<TradeTypes>
		{
			public SorterMode SorterMode;
			public IdComparer()
			{ }
			public IdComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<TradeTypes> Membres
			int System.Collections.Generic.IComparer<TradeTypes>.Compare(TradeTypes x, TradeTypes y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Id.CompareTo(x.Id);
				}
				else
				{
					return x.Id.CompareTo(y.Id);
				}
			}
			#endregion
		}
		public class TitleComparer : System.Collections.Generic.IComparer<TradeTypes>
		{
			public SorterMode SorterMode;
			public TitleComparer()
			{ }
			public TitleComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<TradeTypes> Membres
			int System.Collections.Generic.IComparer<TradeTypes>.Compare(TradeTypes x, TradeTypes y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Title.CompareTo(x.Title);
				}
				else
				{
					return x.Title.CompareTo(y.Title);
				}
			}
			#endregion
		}
	}
}
